<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>紧急登记表</title>
  <!-- 新 Bootstrap 核心 CSS 文件 -->
  <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>


</head>

<body>
<img src="img/logol.jpg" class="img-rounded">
<form class="form-horizontal" role="form">
  <div class="form-group">
    <label for="firstperson" class="col-sm-2 control-label">紧急联系人</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="firstperson" placeholder="请输入名字">
    </div>
  </div>


  <div class="form-group">
    <label for="lastrelation" class="col-sm-2 control-label">关系</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="lastrelation" placeholder="请输入">
    </div>
  </div>

  <div class="form-group">
    <label for="lastcontacts" class="col-sm-2 control-label">联系方式</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="lastcontacts" placeholder="请输入联系人电话">
    </div>
  </div>

  <div class="form-group">
    <label for="lastunit" class="col-sm-2 control-label">工作单位</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="lastunit" placeholder="请输入单位名称">
    </div>
  </div>






  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default" onclick="saveOf()"><a href="index2.html">下一步</a></button>
    </div>
  </div>



</form>
</body>

<script>

    function save() {
        obj = document.getElementById("of");
        $.ajax({
            type: "post",
            url: "http://localhost:8080/of/saveOf",
            data: {"oname": obj.value.toString()},
            // 异步回调
            success: function (result) {
                if (result == 1) {
                    alert("提交成功")
                } else {
                    alert("提交失败")
                }
            }
        });
    }

</script>

</html>
